/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.c0910g.entity;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author BachLe
 */
@Stateless
public class PaymentTypeFacade extends AbstractFacade<PaymentType> {
    @PersistenceContext(unitName = "RadioCabsProject-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public PaymentTypeFacade() {
        super(PaymentType.class);
    }

    public List<PaymentType> getPaymentTypes(String payType){
        String eql = "SELECT p FROM PaymentType p WHERE p.paymentTypeName = '"+payType+"'";
        return em.createQuery(eql).getResultList();
    }
}
